<html>
<head>
	<title>Hasil Perhitungan</title>
    <script type="text/javascript" src="../../js/jquery-1.4.min.js"></script>
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript"> //update field bobot
	function pilihdata(){
		var rows=document.getElementById('pilih_bobot').getElementsByTagName(''),
		i,
		// next line assumes only one element with this style
		select=document.querySelectorAll(".jenispembiayaan")[0], 
		index;
		for(i=0;i<rows.length;i++){
			rows[i].style.display="none";
		}
		//get the index of the select
		index=select.selectedIndex-1;
		if(index>-1){
			rows[index].style.display="block";
			document.getElementById('divAkad').style.display = 'block';
			return
		}
		document.getElementById('divAkad').style.display = 'none';
	}
	</script>
</head>
<body>
	<h1>Hasil Perhitungan</h1>
    <form>
    	<select id="pilih_bobot" onChange="pilihdata();">
        	<option value="0">-Pilih Bobot-</option>
        	<?php
			$id = 1; 
			foreach ($bobot as $list){ ?>
        	<option value="<?php echo $list->id_bobot; ?>"><?php echo $list->nama_b;?></option>
            <?php $id++; }?>
        </select>
    <table border="1">
    <tr>
    	<td></td>
        <td>Hasil PEARL</td>
        <td></td>
        <td>Bobot</td>
    </tr>
    <tr>
    	<td>P</td>
        <td>16</td>
        <td>x</td>
        <td><input type="text" name="nP1" id="nP1"/>%</td>
    </tr>
    <tr>
    	<td>E</td>
        <td>20</td>
        <td>x</td>
        <td><input type="text" name="nE1" id="nE1"/>%</td>
    </tr>
    <tr>
    	<td>A</td>
        <td>30</td>
        <td>x</td>
        <td><input type="text" name="nA1" id="nA1"/>%</td>
    </tr>
    <tr>
    	<td>R</td>
        <td>70</td>
        <td>x</td>
        <td><input type="text" name="nR1" id="nR1"/>%</td>
    </tr>
    <tr>
    	<td>L</td>
        <td>30</td>
        <td>x</td>
        <td><input type="text" name="nL1" id="nL1"/>%</td>
    </tr>
    <tr>
    	<td>S</td>
        <td>60</td>
        <td>x</td>
        <td><input type="text" name="nS1" id="nS1"/>%</td>
    </tr>
    </table>
    </form>
</body>
</html>